package com.lzy.concertticket.controller;

import com.lzy.concertticket.aop.log.ApiLog;
import com.lzy.concertticket.model.R;
import com.lzy.concertticket.model.req.LoginReq;
import com.lzy.concertticket.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private AuthService authService;

    @ApiLog(title = "登录")
    @RequestMapping("/login")
    public R login(@RequestBody LoginReq loginReq) {

        String token = authService.login(loginReq);
        return R.success(token);
    }

}
